#pragma once

namespace LSH
{

class File
{
public:
    File();
    File(String& fileName);

    ~File();
public:
    bool open(String& fileName);
    void close();
    int length() const;
    int position() const;
public:
    bool seekSet(int offset = 0);
    bool seekCur(int offset);
    bool seekEnd(int offset = 0);
public:
    bool endOfFile() const;

    char parseChar() const;
    short parseShort() const;
    int parseInt() const;
    float parseFloat() const;
    double parseDouble() const;

    unsigned int readString(char *stringBuffer) const;
    int read(void *buffer, int size, int count) const;
    unsigned char readByte() const;
    char readChar() const;
    unsigned short readWord() const;
    unsigned int readDWord() const;
    float readFloat() const;
    double readDouble() const;

protected:
    FILE*   _pFileHandle;

    String  _fileFullPath;
};

}   // LSH
